package com.canaan.business.common.enums.agv;

import java.util.Objects;

/**
 * @author
 */
public interface AgvEnum {

    enum SYN_STATUS {
        FAIL("FAIL", "失败"),
        CANCEL("CANCEL", "取消"),
        SUCCESS("SUCCESS", "成功");

        SYN_STATUS(String code, String message) {
            this.code = code;
            this.message = message;
        }

        private String code;
        private String message;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    /**
    * AGV运行方向
    */
    enum AGV_ROUTE_DIRECTION {
        UP("UP", "向上"),
        DOWN("DOWN", "向下"),
        LEFT("LEFT", "向左"),
        RIGHT("RIGHT", "向右");

        AGV_ROUTE_DIRECTION(String code, String message) {
            this.code = code;
            this.message = message;
        }

        private String code;
        private String message;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    /**
     * IN OUT 进出 点位
     */
    enum IN_OUT {
        IN("IN", "进"),
        OUT("OUT", "出");

        private String code;
        private String message;

        IN_OUT(String code, String message) {
            this.code = code;
            this.message = message;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }
    /**
     * AGV任务状态
     */
    enum AGV_TASK_STATUS {
        SENDING("SENDING", "待发送"),
        SENT("SENT", "已发送"),
        START("START", "任务开始"),
        EXECUTING("EXECUTING","执行中"),
        OUTBIN("OUTBIN", "走出储位"),
        HOLD_UP("HOLD_UP", "举起等待"),
        LOCATE_SORT_VERIFY("LOCATE_SORT_VERIFY", "到达接排序验证点"),
        LEAVE_SORT_VERIFY("LEAVE_SORT_VERIFY", "离开接排序验证点"),
        LOCATE_LINE_WAIT1("LOCATE_LINE_WAIT1", "到达接驳线等待点1"),
        LEAVE_LINE_WAIT1("LEAVE_LINE_WAIT1", "离开接驳线等待点1"),
        LOCATE_LINE_WAIT2("LOCATE_LINE_WAIT2", "到达接驳线等待点2"),
        LEAVE_LINE_WAIT2("LEAVE_LINE_WAIT2", "离开接驳线等待点2"),
        LOCATE_LINE_WAIT3("LOCATE_LINE_WAIT3", "到达接驳线等待点3"),
        LEAVE_LINE_WAIT3("LEAVE_LINE_WAIT3", "离开接驳线等待点3"),
        LOCATE_LINE_WAIT4("LOCATE_LINE_WAIT4", "到达接驳线等待点4"),
        LEAVE_LINE_WAIT4("LEAVE_LINE_WAIT4", "离开接驳线等待点4"),
        CANCEL("cancel", "已取消"),
        EXCEPTION("EXCEPTION","任务异常"),
        SUSPEND("SUSPEND","暂停"),
        END("END", "结束");

        AGV_TASK_STATUS(String code, String message) {
            this.code = code;
            this.message = message;
        }

        private String code;
        private String message;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    /**
     * 区域/点位
     */
    enum STOREHOUSE_TYPE {
        LOCATION("LOCATION", "点位"),
        AREA("AREA", "区域");

        STOREHOUSE_TYPE(String code, String message) {
            this.code = code;
            this.message = message;
        }

        private String code;
        private String message;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    /**
     * 是否
     */
    enum IS_ENABLE {
        Y("Y", "是"),
        N("N", "否");

        IS_ENABLE(String code, String message) {
            this.code = code;
            this.message = message;
        }

        private String code;
        private String message;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    /**
     * 点位状态
     */
    enum STOREHOUSE_STATUS {
        USING("USING", "满仓"),
        FREE("FREE", "闲置"),
        EMPTY("EMPTY", "空料架/空料盒/空托盘"),
        LOCK("LOCK", "锁定");

        private String code;
        private String message;

        STOREHOUSE_STATUS(String code, String message) {
            this.code = code;
            this.message = message;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        /**
         * 判断传入的状态是否正确
         * @param status 状态
         * @return
         */
        public static boolean checkStatus(String status){
            for (STOREHOUSE_STATUS value : values()) {
                if (Objects.equals(value.getCode(), status)) {
                    return true;
                }
            }
            return false;
        }
    }
    /**
     * 点位状态
     */
    enum LOCK_STATUS {
        UNLOCK("UNLOCK", "解锁"),
        LOCK("LOCK", "锁定");

        private String code;
        private String message;

        LOCK_STATUS(String code, String message) {
            this.code = code;
            this.message = message;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    enum DEVICE_TYPE {
        LATENT_AGV_SMALL("MR-Q2L-300LE-A2(H)", "潜伏式AGV(小)"),
        LATENT_AGV_LARGE("MR-Q3-1000CE-C5(M)", "潜伏式AGV(大)"),
        FORKLIFT_AGV("MR-F4-1000-C1(S)", "叉车式AGV"),
        TRANSFER_AGV("MR-C3-400LB4-A1(M)", "移载式AGV"),
        CTU_AGV("MR-F0-50DCSH-A1(M)", "CTU式AGV");

        private String code;
        private String message;

        DEVICE_TYPE(String code, String message) {
            this.code = code;
            this.message = message;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    /**
     * 提升机枚举
     */
    enum ELEVATOR {
        FIRST_AND_SECOND_ELEVATOR_1("FIRST_AND_SECOND_ELEVATOR_1", "潜伏式AGV(小)"),
        FIRST_AND_SECOND_ELEVATOR_2("FIRST_AND_SECOND_ELEVATOR_2", "潜伏式AGV(大)");

        private String code;
        private String message;

        ELEVATOR(String code, String message) {
            this.code = code;
            this.message = message;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    /**
     * 提升机枚举
     */
    enum TASK_TYPE {
        IN("IN","入库任务"),
        OUT("OUT","出库任务"),
        ADJUST("ADJUST","调库任务"),
        APPLY_EMPTY("APPLY_EMPTY","呼叫空料架"),
        BACK("BACK","回库任务"),
        IN_EMPTY_TRAYS("IN_EMPTY_TRAYS","入空托盘组"),
        OUT_EMPTY_TRAYS("OUT_EMPTY_TRAYS","出空托盘组"),
        ;

        private String code;
        private String message;

        TASK_TYPE(String code, String message) {
            this.code = code;
            this.message = message;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    /**
     * RCS任务模板类型
     */
    enum AGV_TASK_TYPE {
//        W01("W01","呼叫空货架"),   // 一次性发点位
//        W02("W02","前排装载-后排装载"),  // 一次性发点位,优先选择中间三个点位
//        W03("W03","后排装载入库"),   //一次性发点位
//        W04("W04","座椅发运"),      //点位多次发放
//        W05("W05","排序错乱插队"),   //点位多次发放
//        W06("W06","空托盘入库");    //一次性发放点位
        F001("F001","叉车式"),
        A002("A002","潜伏式"),
        B001("B001","夹报式");

        private String code;
        private String message;

        AGV_TASK_TYPE(String code, String message) {
            this.code = code;
            this.message = message;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    /**
     * 提升机枚举
     */
    enum OCCUPY {
        EMPTY("EMPTY",0,"空"),
        QUARTER("QUARTER",0.25,"四分之一"),
        ONE_HALF("ONE_HALF",0.5,"二分之一"),
        THREE_QUARTER("THREE_QUARTER",0.75,"四分之三"),
        FULL("FULL",1,"满");

        private String code;
        private double value;
        private String message;

        OCCUPY(String code,double value, String message) {
            this.code = code;
            this.message = message;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public double getValue() {
            return value;
        }

        public void setValue(double value) {
            this.value = value;
        }
    }

}
